//导入mongoose
const mongoose=require('./connect')


//用户表的schema
const userSchema=new mongoose.Schema({
    username: {
        required: true,
        type: String
    },
    password: {
        required: true,
        type: String
    },
    email: {
        required: true,
        type: String
    },
    tel: {
        required: true,
        type: Number
    },
    enable: {
        type: Boolean,
        default: false
    },
    createdAt: {
        type: Date,
        default: +new Date()
    },
    updatedAt: {
        type: Date,
        default: +new Date()
    }
})


const userModel=mongoose.model('user',userSchema,'user')


module.exports=userModel
